<%@ page import="javax.persistence.EntityManager" %>
<%@ page import="blogger.model.utils.EMF" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.LinkedList" %>
<%@ page import="blogger.model.entity.MessageEntity" %>
<%@ page import="javax.persistence.Query" %>
<%@ page import="blogger.model.entity.UserEntity" %>
<%--
  Created by IntelliJ IDEA.
  User: mega
  Date: 26.12.2009
  Time: 2:16:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Simple jsp page</title></head>
<body>
<%
//    EntityManager em = EMF.get().createEntityManager();
//    List<MessageEntity> messageEntities = null;
//    Query query = em.createQuery("select m from MessageEntity m order by m.date desc");
//    query.setMaxResults(10);
//    messageEntities = (List<MessageEntity>) query.getResultList();
//    for(MessageEntity m : messageEntities)
//    response.getWriter().println(m.getDate() + m.getText());
//    response.getWriter().println(session.getId());
//    Query query = em.createQuery("SELECT u FROM UserEntity u WHERE u.id = 1");
//    UserEntity userEntity = (UserEntity) query.getSingleResult();
//    response.getWriter().print(userEntity.getLogin());
    response.getWriter().print(session.getAttribute("id"));
%>
</body>
</html>